package com.example.data.holidays;

import com.alibaba.fastjson.JSON;

import java.util.List;
import java.util.Map;

public class Holidays {
    private Long empID;
    private Integer availableHolidays;
    private Integer restHolidays;
    public Long getEmpID(){
        return empID;
    }
    public Integer getAvailableHolidays(){
        return availableHolidays;
    }
    public Integer getRestHolidays(){
        return restHolidays;
    }
    public void setEmpID(Long empID){
        this.empID = empID;
    }
    public void setAvailableHolidays(Integer availableHolidays) {
        this.availableHolidays = availableHolidays;
    }
    public void setRestHolidays(Integer restHolidays) {
        this.restHolidays = restHolidays;
    }
    @Override
    public String toString(){
        StringBuffer str = new StringBuffer();
        str.append("empID " + empID + " ");
        str.append("availableHolidays " + availableHolidays + " ");
        str.append("restHolidays " + restHolidays + " ");
        return str.toString();
    }
    public static Holidays MapConvert(String holidaysString){
        Map<String, Object> map = (Map<String, Object>)JSON.parse(holidaysString);
        Holidays holidays = JSON.parseObject(map.get("Holidays").toString(), Holidays.class);
        return holidays;
    }
}
